import React, { Component } from 'react'
import { Layout } from 'antd';
import { Route, Switch, NavLink, Link ,BrowserRouter,Redirect} from 'react-router-dom'
import { Menu, Button } from 'antd';
import RouterView from '../router/routerView';
import RouterList from "../router/routerList"
import Tou from "./Tou"
import {
  AppstoreOutlined,
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  PieChartOutlined,
  DesktopOutlined,
  ContainerOutlined,
  MailOutlined,
} from '@ant-design/icons';
const { SubMenu } = Menu;
const { Header, Footer, Sider, Content } = Layout;
 class App extends Component {
    state = {
        collapsed: 'false',
    };
    toggleCollapsed = () => {
        this.setState({
          collapsed: !this.state.collapsed,
        });
    };
  render() {
    return (
    <BrowserRouter>
           <div className='app-wrap'>
                <Layout>
                    <Header>
                      <Tou></Tou>
                    </Header>
                    <Layout>
                        <Sider>
                        <div style={{ width: 200 }}>
                            <Menu
                            defaultSelectedKeys={['1']}
                            defaultOpenKeys={['sub1']}
                            mode="inline"
                            theme="dark"
                            collapsed={this.state.collapsed}
                            >
                            <Menu.Item key="1" icon={<PieChartOutlined />}>
                                <NavLink to="/dh1">导航1</NavLink>
                            </Menu.Item>
                            <SubMenu key="sub1" icon={<MailOutlined />} title="Navigation One">
                                <Menu.Item key="2">
                                <NavLink to="/dh2">导航2</NavLink>
                                </Menu.Item>
                                <Menu.Item key="3">
                                <NavLink to="/dh3">导航3</NavLink>
                                </Menu.Item>
                            </SubMenu>
                            </Menu>
      </div>
                        </Sider>
                        <Content>
                           <RouterView RouterList={RouterList}></RouterView>
                        </Content>
                    </Layout>
                </Layout>

      </div>
    </BrowserRouter>
   
    )
  }
}

export default App